<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>My JSP 'index.html' starting page</title>
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
<meta http-equiv="description" content="This is my page" />
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
<link rel="stylesheet" type="text/css" href="../../css/admin.css" />
-->
<link rel="stylesheet" href="../../css/admin.css" type="text/css"></link>

<script type="text/javascript" src="../../js/jquery.js"></script>

<script type="text/javascript">
function checkNew() {
	var id = document.getElementById("userId").value;
	var oldPass = document.getElementById("oldPass").value;
	var newPass = document.getElementById("newPass").value;
	var anewPass = document.getElementById("anewPass").value;
	if (oldPass == "" || newPass == "" || anewPass == "") {
		//alert(oldPasss + ' || ' + newPass + ' || ' + anewPass);
		alert("密码不能为空");
	} else if (newPass != anewPass) {
		alert("两次新密码输入不相等");
	} else {
		$.getJSON("/storage/admin/pages/loginUser.do?method=editOperatorPass&d=" + new Date(), {
			oldPass : oldPass,
			newPass : anewPass
		}, function(data) {
			alert(data[0]);
			window.location.reload();
		});//getJson
	}//else
}//check

function ret() {
	window.location.reload();
}

function isTruePass(in_data) {
	var flage = 10;
	var inDataValue = in_data.value;
	if (inDataValue.length > flage) {
		in_data.value = inDataValue.substring(0, flage);
		news.innerHTML = "您输入的密码过长，最大长度是10位";
	} else {
		news.innerHTML = "";
	}
}
</script>
</head>

<BODY>
<div id="div_header">
  <div id="div_titel">
    修改口令
  </div>
</div>
<!-- 页面主体显示培训班列表 -->
<center>
  <form id="aform" name="form1" action="javascript:void()" method="post">
    <input type="hidden" name="userId" id="userId" value="" />
    旧密码：
    <input type="password" name="oldPass" id="oldPass" style="width: 180px; text-align: center" />
    <br />
    新密码：
    <input type="password" name="newPass" id="newPass" style="width: 180px; text-align: center" onkeyup="isTruePass(this)" />
    <br />
    请确认：
    <input type="password" name="anewPass" id="anewPass" style="width: 180px; text-align: center" onkeyup="isTruePass(this)" />
    <br />
    <span id="news" style="color: #F00"></span> <br />
    <input type="reset" value="重置" />&nbsp;&nbsp;&nbsp;<input type="button" value="提交" onClick="checkNew()" class="submit" style="width:60px;" />
  </form>
</center>
</body>
</html>
